<%@page import="DTO.Administrador"%>
<%@page import="org.apache.tomcat.util.http.fileupload.FileUploadException" %>
<%@page import="org.apache.tomcat.util.http.fileupload.FileItem"%>
<%@page import="java.util.Hashtable"%>
<%@page import="java.util.Iterator"%>
<%@page import="org.apache.tomcat.util.http.fileupload.disk.DiskFileItemFactory"%>
<%@page import="org.apache.tomcat.util.http.fileupload.servlet.ServletFileUpload"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>


<!DOCTYPE html>
<html>
    <%
        //Obtiener la sesion
        HttpSession sesion = request.getSession();
        Administrador admin = (Administrador) session.getAttribute("Administrador");
        String cedula = request.getParameter("cedula");
        System.out.println(cedula);
        //Valida el usuario 
        if (admin != null) {%>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Registro de pacientes | Cargar foto</title>
        <link rel="stylesheet" type="text/css" href="css/style.css?9" media="screen" />
        <link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="css/default.css" />        
        <link rel="shortcut icon" href="img/sign.ico"  type="image/x-icon"   />

        <script type="text/javascript" src="js/js_common.js"></script> 

        <!-- css y js para validación -->
        <link rel="stylesheet" type="text/css" href="css/styleValidationEngine.css" media="screen" />
        <script type="text/javascript" src="jquery/jquery-1.8.2.min.js" charset="utf-8"></script>
        <script type="text/javascript" src="jquery/jquery.validationEngine-es.js" charset="utf-8"></script>
        <script type="text/javascript" src="jquery/jquery.validationEngine.js" charset="utf-8" ></script> 

        <script type="text/javascript" >
            jQuery(document).ready(function(){
                jQuery("#subirFoto").validationEngine();
            });
                    
        </script>
    </head>
    <body bgcolor="#FFFFCC">
        <div id="wrap">
            <div id="top">
                <h2>Foto del paciente </h2> 
                <div style="margin-left: 40%;margin-bottom: 3.6%;"> <h1>Usuario:<%= admin.getNombre()%></h1> </div>
                <a href="javascript:cerrar_sesion()">Cerrar sesión</a>
            </div>
            <div style="color: #ffffff; margin-left:2%; font-size: 1.6em;">
                <script type="text/javascript" language="JavaScript">
                    document.write(Muestrafecha());
                </script>
            </div>

            <div id="content">
                <div id="left">
                    <form name="subirFoto" id="subirFoto" action="ServicioActualizaImagen" enctype="multipart/form-data" method="POST">
                        <div class="box">
                            <div id="login-box">

                                <h1>Cargar foto del paciente</h1> 
                                <div style="float: left;"> <input type="hidden" id="cedula" name="cedula" class="validate[required]" value="<%= cedula%>" /> </div>  
                                <br/> <br/> <br/>
                                <div style="text-align: left;"><strong>Foto del Paciente:</strong></div> 
                                <div style="float: left;"><input type="file"  id="foto" name="foto" class="file" />
                                </div>
                                <br/> <br/> <br/> 

                                <div style="float:left; margin-right: 3%">

                                    <input class="button" type="submit" value="Guardar foto" name="GuardarFoto" />
                                </div>
                                <div style="float:left;">
                                    <input id="back1" name="back1" class="button" 
                                           type="button" value="Atrás"  onclick="parent.location='HojaDatosPaciente.jsp?id=<%= cedula%>'"/>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div id="right"> <!-- left -->
                    <br/> <br/> 
                    <div class="logo_foto"> </div>
                </div>

            </div>   
            <p id="info" name="info">

            </p>

        </div>  <br />  <br />  
        <div id="footer">
            <footer>
                <div><img src="img/footer_img.png" height="39" width="960" border="0"></div>
                <h4>
                    <a href="MapaSitio.jsp">MAPA DEL SITIO</a> | 
                    <a href="Desarrolladores.jsp" accesskey="H" onClick="popup = window.open('Desarrolladores.jsp', 'PopupPage','height=550,width=600,scrollbars=yes,resizable=no'); return false" target="_blank" onMouseOver="window.status='';  return true" onMouseOut="window.status=''; return true"onFocus="window.status='';  return true" onBlur="window.status=''; return true"  class="submenulinktext2">DESAROLLADORES</a> | 
                    <a href="Ayuda.jsp" accesskey="H" onClick="popup = window.open('Ayuda.jsp', 'PopupPage','height=550,width=600,scrollbars=yes,resizable=no'); return false" target="_blank" onMouseOver="window.status='';  return true" onMouseOut="window.status=''; return true"onFocus="window.status='';  return true" onBlur="window.status=''; return true"  class="submenulinktext2">AYUDA</a>
                </h4>
                <div class="ftext"> Tel:(506) 2246-3279 <br/> sapcomed &copy;  Todos los derechos reservados. Prohibida la reproducción total o parcial.</div>
            </footer>

        </div>
    </body>
    <% }%>
</html>